<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
<div id="app">
    <div>{{message}}</div>
</div>


<script src="../js/vue.js"></script>
<script src="../js/axios.js"></script>
<script>
    const instance = axios.create({
        baseURL: 'http://localhost:8972/',
        timeout: 10000,
        headers: {'X-Custom-Header': 'foobar'}
    });
    const vm = new Vue({
        el: "#app",
        data: {
            message: "Nihao"
        },
        methods: {},
        created: function () {
            axios.request({
                method: 'post',
                url: '/test',
                data: {
                    name: '李四',
                    id: '23',
                    date: new Date()
                }
            }).then(function (res) {
                console.log(res)
            })
        },
        mounted: function () {
            instance.get('/test').then(function (res) {
                console.log(res)
            })
        }
    })


</script>
</body>
</html>